/**
 * Created by user on 2017/9/21.
 */
import React, { Component } from 'react';
import Dashboard from '../pages/Dashboard';
import About from '../pages/About';
import Chat from '../pages/Chat';
import Setting from '../pages/Setting';
import Message from '../pages/Message';
import TestMessage from '../pages/Message';
import Login from '../pages/Login';
import Page404 from '../pages/404';
import { HashRouter, Link , Switch} from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
import Route from '../lib/AuthRoute';
import createHistory from 'history/createHashHistory';
const history = createHistory();
class App extends Component{
    render(){
        return(
            <ConnectedRouter history={history}>
                <Switch>
                    <Route exact needAuth={true} path="/" component={Setting}/>
                    <Route exact needAuth={false} path="/login" component={Login}/>
                    <Route needAuth={false} path="/dashboard" component={Dashboard}/>
                    <Route needAuth={true} path="/about" component={About}/>
                    <Route needAuth={true} path="/chat" component={Chat}>

                    </Route>
                    <Route needAuth={true} path="/message/:id" component={Message}/>
                    <Route needAuth={true} component={Page404}/>
                </Switch>
            </ConnectedRouter>
        )
    }
}
export default App;